/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.netbeans.modules.csourcefilepalette.items.resources;

import edu.mass.qcc.qcccodewizard.*;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.text.BadLocationException;
import javax.swing.text.Document;
import javax.swing.text.JTextComponent;
import org.netbeans.api.editor.EditorRegistry;
import org.netbeans.modules.editor.NbEditorUtilities;
import org.openide.filesystems.FileUtil;
import org.openide.util.Exceptions;

/**
 * Ian
 */
public final class MainCodePopup extends JFrame {

    /**
     *
     */
    public MainCodePopup() {
        initComponents();



    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        buttonGroupVariable = new javax.swing.ButtonGroup();
        jLayeredPane1 = new javax.swing.JLayeredPane();
        jPanel1 = new javax.swing.JPanel();
        jScrollPane9 = new javax.swing.JScrollPane();
        decPane = new javax.swing.JPanel();
        jTabbedPane2 = new javax.swing.JTabbedPane();
        jPanel3 = new javax.swing.JPanel();
        varPane = new javax.swing.JPanel();
        jRadioButton1 = new javax.swing.JRadioButton();
        jRadioButton2 = new javax.swing.JRadioButton();
        jRadioButton3 = new javax.swing.JRadioButton();
        jRadioButton4 = new javax.swing.JRadioButton();
        jRadioButton5 = new javax.swing.JRadioButton();
        jRadioButton6 = new javax.swing.JRadioButton();
        jRadioButton7 = new javax.swing.JRadioButton();
        jRadioButton8 = new javax.swing.JRadioButton();
        jRadioButton9 = new javax.swing.JRadioButton();
        varNameCombo1 = new javax.swing.JComboBox();
        jLabel4 = new javax.swing.JLabel();
        addVariableButton = new javax.swing.JButton();
        jLabel33 = new javax.swing.JLabel();
        jLabel39 = new javax.swing.JLabel();
        jPanel4 = new javax.swing.JPanel();
        expPane = new javax.swing.JPanel();
        vCb2 = new javax.swing.JComboBox();
        vCb4 = new javax.swing.JComboBox();
        vCb3 = new javax.swing.JComboBox();
        vCb5 = new javax.swing.JComboBox();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        vCb9 = new javax.swing.JComboBox();
        jLabel3 = new javax.swing.JLabel();
        vCb10 = new javax.swing.JComboBox();
        addVarDecButton = new javax.swing.JButton();
        vCb6 = new javax.swing.JComboBox();
        vCb8 = new javax.swing.JComboBox();
        jLabel9 = new javax.swing.JLabel();
        vCb11 = new javax.swing.JComboBox();
        vCb12 = new javax.swing.JComboBox();
        vCb13 = new javax.swing.JComboBox();
        decCb = new javax.swing.JCheckBox();
        stCb = new javax.swing.JCheckBox();
        conCb = new javax.swing.JCheckBox();
        jLabel32 = new javax.swing.JLabel();
        jLabel41 = new javax.swing.JLabel();
        jPanel5 = new javax.swing.JPanel();
        strPane = new javax.swing.JPanel();
        addStrButton = new javax.swing.JButton();
        jLabel5 = new javax.swing.JLabel();
        strName = new javax.swing.JTextField();
        jLabel6 = new javax.swing.JLabel();
        strValue = new javax.swing.JTextField();
        jLabel7 = new javax.swing.JLabel();
        strArrName = new javax.swing.JTextField();
        jLabel8 = new javax.swing.JLabel();
        strArrValue = new javax.swing.JTextField();
        jLabel31 = new javax.swing.JLabel();
        strCb = new javax.swing.JCheckBox();
        strArrCb = new javax.swing.JCheckBox();
        jLabel43 = new javax.swing.JLabel();
        loopTabPane = new javax.swing.JTabbedPane();
        ifPane = new javax.swing.JPanel();
        jLabel13 = new javax.swing.JLabel();
        whileName = new javax.swing.JComboBox();
        whileOp = new javax.swing.JComboBox();
        whileValue = new javax.swing.JComboBox();
        jLabel14 = new javax.swing.JLabel();
        jScrollPane2 = new javax.swing.JScrollPane();
        whileBody = new javax.swing.JTextArea();
        jLabel15 = new javax.swing.JLabel();
        addWhileButton = new javax.swing.JButton();
        jLabel34 = new javax.swing.JLabel();
        jLabel40 = new javax.swing.JLabel();
        jLabel42 = new javax.swing.JLabel();
        doPane = new javax.swing.JPanel();
        jLabel19 = new javax.swing.JLabel();
        jScrollPane4 = new javax.swing.JScrollPane();
        doBody = new javax.swing.JTextArea();
        jLabel20 = new javax.swing.JLabel();
        doWhileName = new javax.swing.JComboBox();
        doWhileOp = new javax.swing.JComboBox();
        doWhileValue = new javax.swing.JComboBox();
        jLabel26 = new javax.swing.JLabel();
        addDoWhile = new javax.swing.JButton();
        forPane = new javax.swing.JPanel();
        jLabel21 = new javax.swing.JLabel();
        forType = new javax.swing.JComboBox();
        forName = new javax.swing.JComboBox();
        forOp = new javax.swing.JComboBox();
        forValue = new javax.swing.JComboBox();
        jLabel22 = new javax.swing.JLabel();
        forName2 = new javax.swing.JComboBox();
        forOp2 = new javax.swing.JComboBox();
        forConValue = new javax.swing.JComboBox();
        forName3 = new javax.swing.JComboBox();
        forOp3 = new javax.swing.JComboBox();
        jLabel24 = new javax.swing.JLabel();
        jLabel23 = new javax.swing.JLabel();
        jLabel25 = new javax.swing.JLabel();
        jScrollPane5 = new javax.swing.JScrollPane();
        forBody = new javax.swing.JTextArea();
        addForButton = new javax.swing.JButton();
        jPanel2 = new javax.swing.JPanel();
        addForEach = new javax.swing.JButton();
        jLabel35 = new javax.swing.JLabel();
        jLabel28 = new javax.swing.JLabel();
        forEachType = new javax.swing.JComboBox();
        forEachName = new javax.swing.JComboBox();
        jLabel36 = new javax.swing.JLabel();
        forEachArrayName = new javax.swing.JComboBox();
        jLabel37 = new javax.swing.JLabel();
        jScrollPane7 = new javax.swing.JScrollPane();
        forEachBody = new javax.swing.JTextArea();
        jLabel38 = new javax.swing.JLabel();
        jPanel6 = new javax.swing.JPanel();
        jTabbedPane1 = new javax.swing.JTabbedPane();
        jPanel8 = new javax.swing.JPanel();
        jLabel10 = new javax.swing.JLabel();
        ifVarName = new javax.swing.JComboBox();
        ifVarOp = new javax.swing.JComboBox();
        ifVarValue = new javax.swing.JComboBox();
        jLabel11 = new javax.swing.JLabel();
        jScrollPane1 = new javax.swing.JScrollPane();
        ifBody = new javax.swing.JTextArea();
        jLabel12 = new javax.swing.JLabel();
        addIfStat = new javax.swing.JButton();
        jLabel27 = new javax.swing.JLabel();
        jPanel9 = new javax.swing.JPanel();
        jLabel16 = new javax.swing.JLabel();
        elseIfName = new javax.swing.JComboBox();
        elseIfOp = new javax.swing.JComboBox();
        elseIfValue = new javax.swing.JComboBox();
        jLabel17 = new javax.swing.JLabel();
        jScrollPane3 = new javax.swing.JScrollPane();
        elseIfBody = new javax.swing.JTextArea();
        jLabel18 = new javax.swing.JLabel();
        addElseIfButton = new javax.swing.JButton();
        jPanel7 = new javax.swing.JPanel();
        addElseButton = new javax.swing.JButton();
        jLabel29 = new javax.swing.JLabel();
        jScrollPane6 = new javax.swing.JScrollPane();
        elseBody = new javax.swing.JTextArea();
        jLabel30 = new javax.swing.JLabel();

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.jPanel1.border.title"))); // NOI18N

        decPane.setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.decPane.border.title"))); // NOI18N

        varPane.setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.varPane.border.title"))); // NOI18N
        varPane.setToolTipText(org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.varPane.toolTipText")); // NOI18N

        buttonGroupVariable.add(jRadioButton1);
        org.openide.awt.Mnemonics.setLocalizedText(jRadioButton1, org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.jRadioButton1.text")); // NOI18N
        jRadioButton1.setToolTipText(org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.jRadioButton1.toolTipText")); // NOI18N

        buttonGroupVariable.add(jRadioButton2);
        org.openide.awt.Mnemonics.setLocalizedText(jRadioButton2, org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.jRadioButton2.text")); // NOI18N
        jRadioButton2.setToolTipText(org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.jRadioButton2.toolTipText")); // NOI18N

        buttonGroupVariable.add(jRadioButton3);
        org.openide.awt.Mnemonics.setLocalizedText(jRadioButton3, org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.jRadioButton3.text")); // NOI18N
        jRadioButton3.setToolTipText(org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.jRadioButton3.toolTipText")); // NOI18N

        buttonGroupVariable.add(jRadioButton4);
        org.openide.awt.Mnemonics.setLocalizedText(jRadioButton4, org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.jRadioButton4.text")); // NOI18N
        jRadioButton4.setToolTipText(org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.jRadioButton4.toolTipText")); // NOI18N

        buttonGroupVariable.add(jRadioButton5);
        org.openide.awt.Mnemonics.setLocalizedText(jRadioButton5, org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.jRadioButton5.text")); // NOI18N
        jRadioButton5.setToolTipText(org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.jRadioButton5.toolTipText")); // NOI18N

        buttonGroupVariable.add(jRadioButton6);
        org.openide.awt.Mnemonics.setLocalizedText(jRadioButton6, org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.jRadioButton6.text")); // NOI18N
        jRadioButton6.setToolTipText(org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.jRadioButton6.toolTipText")); // NOI18N

        buttonGroupVariable.add(jRadioButton7);
        org.openide.awt.Mnemonics.setLocalizedText(jRadioButton7, org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.jRadioButton7.text")); // NOI18N
        jRadioButton7.setToolTipText(org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.jRadioButton7.toolTipText")); // NOI18N

        buttonGroupVariable.add(jRadioButton8);
        org.openide.awt.Mnemonics.setLocalizedText(jRadioButton8, org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.jRadioButton8.text")); // NOI18N
        jRadioButton8.setToolTipText(org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.jRadioButton8.toolTipText")); // NOI18N

        buttonGroupVariable.add(jRadioButton9);
        org.openide.awt.Mnemonics.setLocalizedText(jRadioButton9, org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.jRadioButton9.text")); // NOI18N
        jRadioButton9.setToolTipText(org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.jRadioButton9.toolTipText")); // NOI18N

        varNameCombo1.setEditable(true);
        varNameCombo1.setToolTipText(org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.varNameCombo1.toolTipText")); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(jLabel4, org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.jLabel4.text")); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(addVariableButton, org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.addVariableButton.text")); // NOI18N
        addVariableButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                addVariableButtonActionPerformed(evt);
            }
        });

        jLabel33.setIcon(new javax.swing.ImageIcon(getClass().getResource("/edu/mass/qcc/qcccodewizard/Question.png"))); // NOI18N
        org.openide.awt.Mnemonics.setLocalizedText(jLabel33, org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.jLabel33.text")); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(jLabel39, org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.jLabel39.text")); // NOI18N

        javax.swing.GroupLayout varPaneLayout = new javax.swing.GroupLayout(varPane);
        varPane.setLayout(varPaneLayout);
        varPaneLayout.setHorizontalGroup(
            varPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(varPaneLayout.createSequentialGroup()
                .addComponent(jRadioButton1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jRadioButton2)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jRadioButton3)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jRadioButton4)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jRadioButton5)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jRadioButton6)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jRadioButton7)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jRadioButton8)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jRadioButton9)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 410, Short.MAX_VALUE)
                .addComponent(jLabel33))
            .addGroup(varPaneLayout.createSequentialGroup()
                .addComponent(jLabel4)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(varNameCombo1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jLabel39)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(addVariableButton)
                .addGap(0, 0, Short.MAX_VALUE))
        );
        varPaneLayout.setVerticalGroup(
            varPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(varPaneLayout.createSequentialGroup()
                .addGroup(varPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(varPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jRadioButton1)
                        .addComponent(jRadioButton2)
                        .addComponent(jRadioButton3)
                        .addComponent(jRadioButton4)
                        .addComponent(jRadioButton5)
                        .addComponent(jRadioButton6)
                        .addComponent(jRadioButton7)
                        .addComponent(jRadioButton8)
                        .addComponent(jRadioButton9))
                    .addComponent(jLabel33))
                .addGap(28, 37, Short.MAX_VALUE)
                .addGroup(varPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel4)
                    .addComponent(varNameCombo1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel39)
                    .addComponent(addVariableButton))
                .addGap(113, 113, 113))
        );

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(varPane, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(varPane, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        jTabbedPane2.addTab(org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.jPanel3.TabConstraints.tabTitle"), jPanel3); // NOI18N

        expPane.setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.expPane.border.title"))); // NOI18N

        vCb2.setEditable(true);
        vCb2.setModel(new VariableTypeComboBoxModel());
        vCb2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                vCb2ActionPerformed(evt);
            }
        });

        vCb4.setModel(new OperatorListModel());

        vCb3.setEditable(true);
        vCb3.setModel(new VariableNameComboModel());
        vCb3.setToolTipText(org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.vCb3.toolTipText")); // NOI18N

        vCb5.setEditable(true);
        vCb5.setModel(new VariableNameComboModel());
        vCb5.setToolTipText(org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.vCb5.toolTipText")); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(jLabel1, org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.jLabel1.text")); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(jLabel2, org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.jLabel2.text")); // NOI18N

        vCb9.setModel(new VariableNameComboModel());

        org.openide.awt.Mnemonics.setLocalizedText(jLabel3, org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.jLabel3.text")); // NOI18N

        vCb10.setEditable(true);
        vCb10.setModel(new VariableNameComboModel());
        vCb10.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                vCb10ActionPerformed(evt);
            }
        });

        org.openide.awt.Mnemonics.setLocalizedText(addVarDecButton, org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.addVarDecButton.text")); // NOI18N
        addVarDecButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                addVarDecButtonActionPerformed(evt);
            }
        });

        vCb6.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Assignment", "=", "Arithmetic", "+", "-", "*", "/", "%", "Unary", "+", "-", "++", "--", "!", "Equality & Relational", "==", "!=", ">", ">=", "<", "<=", "Conditional", "&&", "||", "?:", "Bitwise and Shift", "~", "<<", ">>", ">>>", "&", "^", "|", " " }));

        vCb8.setEditable(true);
        vCb8.setModel(new VariableNameComboModel());
        vCb8.setToolTipText(org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.vCb8.toolTipText")); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(jLabel9, org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.jLabel9.text")); // NOI18N

        vCb11.setEditable(true);
        vCb11.setModel(new VariableNameComboModel());

        vCb12.setModel(new OperatorListModel());

        vCb13.setEditable(true);
        vCb13.setModel(new VariableNameComboModel());

        org.openide.awt.Mnemonics.setLocalizedText(decCb, org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.decCb.text")); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(stCb, org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.stCb.text")); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(conCb, org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.conCb.text")); // NOI18N

        jLabel32.setIcon(new javax.swing.ImageIcon(getClass().getResource("/edu/mass/qcc/qcccodewizard/Question.png"))); // NOI18N
        org.openide.awt.Mnemonics.setLocalizedText(jLabel32, org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.jLabel32.text")); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(jLabel41, org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.jLabel41.text")); // NOI18N

        javax.swing.GroupLayout expPaneLayout = new javax.swing.GroupLayout(expPane);
        expPane.setLayout(expPaneLayout);
        expPaneLayout.setHorizontalGroup(
            expPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(expPaneLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(expPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(expPaneLayout.createSequentialGroup()
                        .addGroup(expPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(expPaneLayout.createSequentialGroup()
                                .addGap(221, 221, 221)
                                .addComponent(vCb12, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(vCb13, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(jLabel41))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(addVarDecButton))
                    .addGroup(expPaneLayout.createSequentialGroup()
                        .addGroup(expPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(conCb)
                            .addComponent(decCb)
                            .addComponent(stCb))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(expPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel1)
                            .addComponent(jLabel2)
                            .addComponent(jLabel9))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(expPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(vCb2, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(vCb9, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(vCb11, javax.swing.GroupLayout.Alignment.TRAILING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(expPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(expPaneLayout.createSequentialGroup()
                                .addComponent(vCb3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(vCb4, javax.swing.GroupLayout.PREFERRED_SIZE, 105, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(expPaneLayout.createSequentialGroup()
                                .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 12, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(vCb10, javax.swing.GroupLayout.PREFERRED_SIZE, 124, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(vCb5, javax.swing.GroupLayout.PREFERRED_SIZE, 105, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(vCb6, javax.swing.GroupLayout.PREFERRED_SIZE, 84, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(vCb8, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 71, Short.MAX_VALUE)
                        .addComponent(jLabel32))))
        );
        expPaneLayout.setVerticalGroup(
            expPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(expPaneLayout.createSequentialGroup()
                .addGroup(expPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(decCb)
                    .addComponent(jLabel32))
                .addGroup(expPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(expPaneLayout.createSequentialGroup()
                        .addGap(0, 0, Short.MAX_VALUE)
                        .addGroup(expPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(addVarDecButton)
                            .addComponent(jLabel41)))
                    .addGroup(expPaneLayout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(stCb)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(conCb, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap())))
            .addGroup(expPaneLayout.createSequentialGroup()
                .addGroup(expPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(vCb2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(vCb3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(vCb4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(vCb5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(vCb6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(vCb8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel1))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(expPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(expPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(vCb10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel3))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, expPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(vCb9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel2)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(expPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel9)
                    .addComponent(vCb11, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(vCb12, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(vCb13, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(31, 31, 31))
        );

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()
                .addComponent(expPane, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 22, Short.MAX_VALUE))
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addComponent(expPane, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 93, Short.MAX_VALUE))
        );

        jTabbedPane2.addTab(org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.jPanel4.TabConstraints.tabTitle"), jPanel4); // NOI18N

        strPane.setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.strPane.border.title"))); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(addStrButton, org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.addStrButton.text")); // NOI18N
        addStrButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                addStrButtonActionPerformed(evt);
            }
        });

        org.openide.awt.Mnemonics.setLocalizedText(jLabel5, org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.jLabel5.text")); // NOI18N

        strName.setText(org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.strName.text")); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(jLabel6, org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.jLabel6.text")); // NOI18N

        strValue.setText(org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.strValue.text")); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(jLabel7, org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.jLabel7.text")); // NOI18N

        strArrName.setText(org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.strArrName.text")); // NOI18N
        strArrName.setToolTipText(org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.strArrName.toolTipText")); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(jLabel8, org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.jLabel8.text")); // NOI18N

        strArrValue.setText(org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.strArrValue.text")); // NOI18N
        strArrValue.setToolTipText(org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.strArrValue.toolTipText")); // NOI18N

        jLabel31.setIcon(new javax.swing.ImageIcon(getClass().getResource("/edu/mass/qcc/qcccodewizard/Question.png"))); // NOI18N
        org.openide.awt.Mnemonics.setLocalizedText(jLabel31, org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.jLabel31.text")); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(strCb, org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.strCb.text")); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(strArrCb, org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.strArrCb.text")); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(jLabel43, org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.jLabel43.text")); // NOI18N

        javax.swing.GroupLayout strPaneLayout = new javax.swing.GroupLayout(strPane);
        strPane.setLayout(strPaneLayout);
        strPaneLayout.setHorizontalGroup(
            strPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(strPaneLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(strPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(strPaneLayout.createSequentialGroup()
                        .addGroup(strPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addGroup(strPaneLayout.createSequentialGroup()
                                .addComponent(strArrCb)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLabel7))
                            .addGroup(strPaneLayout.createSequentialGroup()
                                .addComponent(strCb)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(jLabel5)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(strPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(strArrName)
                            .addComponent(strName, javax.swing.GroupLayout.DEFAULT_SIZE, 117, Short.MAX_VALUE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(strPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(strPaneLayout.createSequentialGroup()
                                .addComponent(jLabel6)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(strValue, javax.swing.GroupLayout.PREFERRED_SIZE, 250, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(jLabel31))
                            .addGroup(strPaneLayout.createSequentialGroup()
                                .addComponent(jLabel8)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(strArrValue, javax.swing.GroupLayout.PREFERRED_SIZE, 498, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(0, 163, Short.MAX_VALUE))))
                    .addGroup(strPaneLayout.createSequentialGroup()
                        .addComponent(jLabel43)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(addStrButton)
                        .addGap(0, 0, Short.MAX_VALUE))))
        );
        strPaneLayout.setVerticalGroup(
            strPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, strPaneLayout.createSequentialGroup()
                .addGap(0, 0, 0)
                .addGroup(strPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel31)
                    .addGroup(strPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(strCb)
                        .addGroup(strPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel5)
                            .addComponent(strName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel6)
                            .addComponent(strValue, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(strPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(strPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                        .addComponent(strArrValue, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGroup(strPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(strArrName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel7)))
                    .addComponent(jLabel8)
                    .addComponent(strArrCb))
                .addGap(18, 18, 18)
                .addGroup(strPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel43)
                    .addComponent(addStrButton))
                .addContainerGap(107, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(strPane, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(strPane, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        jTabbedPane2.addTab(org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.jPanel5.TabConstraints.tabTitle"), jPanel5); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(jLabel13, org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.jLabel13.text")); // NOI18N

        whileName.setEditable(true);
        whileName.setModel(new VariableNameComboModel());

        whileOp.setModel(new OperatorListModel());

        whileValue.setEditable(true);
        whileValue.setModel(new VariableNameComboModel());

        org.openide.awt.Mnemonics.setLocalizedText(jLabel14, org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.jLabel14.text")); // NOI18N

        whileBody.setColumns(20);
        whileBody.setRows(5);
        whileBody.setText(org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.whileBody.text")); // NOI18N
        jScrollPane2.setViewportView(whileBody);

        org.openide.awt.Mnemonics.setLocalizedText(jLabel15, org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.jLabel15.text")); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(addWhileButton, org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.addWhileButton.text")); // NOI18N
        addWhileButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                addWhileButtonActionPerformed(evt);
            }
        });

        jLabel34.setIcon(new javax.swing.ImageIcon(getClass().getResource("/edu/mass/qcc/qcccodewizard/Question.png"))); // NOI18N
        org.openide.awt.Mnemonics.setLocalizedText(jLabel34, org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.jLabel34.text")); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(jLabel40, org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.jLabel40.text")); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(jLabel42, org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.jLabel42.text")); // NOI18N

        javax.swing.GroupLayout ifPaneLayout = new javax.swing.GroupLayout(ifPane);
        ifPane.setLayout(ifPaneLayout);
        ifPaneLayout.setHorizontalGroup(
            ifPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(ifPaneLayout.createSequentialGroup()
                .addGap(18, 18, 18)
                .addGroup(ifPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(ifPaneLayout.createSequentialGroup()
                        .addComponent(jLabel13)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(whileName, javax.swing.GroupLayout.PREFERRED_SIZE, 99, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(whileOp, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(whileValue, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel14)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jLabel34))
                    .addGroup(ifPaneLayout.createSequentialGroup()
                        .addGap(15, 15, 15)
                        .addGroup(ifPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(ifPaneLayout.createSequentialGroup()
                                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 671, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(addWhileButton))
                            .addGroup(ifPaneLayout.createSequentialGroup()
                                .addComponent(jLabel15, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLabel42)))
                        .addGap(0, 137, Short.MAX_VALUE))))
            .addGroup(ifPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(ifPaneLayout.createSequentialGroup()
                    .addGap(394, 394, 394)
                    .addComponent(jLabel40)
                    .addContainerGap(392, Short.MAX_VALUE)))
        );
        ifPaneLayout.setVerticalGroup(
            ifPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(ifPaneLayout.createSequentialGroup()
                .addGroup(ifPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(ifPaneLayout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(ifPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel13)
                            .addComponent(whileName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(whileOp, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(whileValue, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel14)))
                    .addComponent(jLabel34))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(ifPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(addWhileButton))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(ifPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel15)
                    .addComponent(jLabel42))
                .addContainerGap(33, Short.MAX_VALUE))
            .addGroup(ifPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(ifPaneLayout.createSequentialGroup()
                    .addGap(82, 82, 82)
                    .addComponent(jLabel40)
                    .addContainerGap(95, Short.MAX_VALUE)))
        );

        loopTabPane.addTab(org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.ifPane.TabConstraints.tabTitle"), ifPane); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(jLabel19, org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.jLabel19.text")); // NOI18N

        doBody.setColumns(20);
        doBody.setRows(5);
        doBody.setText(org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.doBody.text")); // NOI18N
        jScrollPane4.setViewportView(doBody);

        org.openide.awt.Mnemonics.setLocalizedText(jLabel20, org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.jLabel20.text")); // NOI18N

        doWhileName.setEditable(true);
        doWhileName.setModel(new VariableNameComboModel());

        doWhileOp.setModel(new OperatorListModel());

        doWhileValue.setEditable(true);
        doWhileValue.setModel(new VariableNameComboModel());

        org.openide.awt.Mnemonics.setLocalizedText(jLabel26, org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.jLabel26.text")); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(addDoWhile, org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.addDoWhile.text")); // NOI18N
        addDoWhile.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                addDoWhileActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout doPaneLayout = new javax.swing.GroupLayout(doPane);
        doPane.setLayout(doPaneLayout);
        doPaneLayout.setHorizontalGroup(
            doPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(doPaneLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel19)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(doPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(doPaneLayout.createSequentialGroup()
                        .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 671, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(addDoWhile)
                        .addContainerGap(133, Short.MAX_VALUE))
                    .addGroup(doPaneLayout.createSequentialGroup()
                        .addComponent(jLabel20)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(doWhileName, javax.swing.GroupLayout.PREFERRED_SIZE, 99, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(doWhileOp, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(doWhileValue, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel26)
                        .addGap(0, 0, Short.MAX_VALUE))))
        );
        doPaneLayout.setVerticalGroup(
            doPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(doPaneLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(doPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel19)
                    .addComponent(addDoWhile, javax.swing.GroupLayout.Alignment.TRAILING))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(doPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel20)
                    .addComponent(doWhileName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(doWhileOp, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(doWhileValue, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel26))
                .addContainerGap(53, Short.MAX_VALUE))
        );

        loopTabPane.addTab(org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.doPane.TabConstraints.tabTitle"), doPane); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(jLabel21, org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.jLabel21.text")); // NOI18N

        forType.setEditable(true);
        forType.setModel(new VariableTypeComboBoxModel());
        forType.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                forTypeActionPerformed(evt);
            }
        });

        forName.setEditable(true);
        forName.setModel(new VariableNameComboModel());

        forOp.setModel(new OperatorListModel());

        forValue.setEditable(true);
        forValue.setModel(new VariableNameComboModel());

        org.openide.awt.Mnemonics.setLocalizedText(jLabel22, org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.jLabel22.text")); // NOI18N

        forName2.setEditable(true);
        forName2.setModel(new VariableNameComboModel());

        forOp2.setModel(new OperatorListModel());

        forConValue.setEditable(true);
        forConValue.setModel(new VariableNameComboModel());

        forName3.setEditable(true);
        forName3.setModel(new VariableNameComboModel());

        forOp3.setModel(new OperatorListModel());

        org.openide.awt.Mnemonics.setLocalizedText(jLabel24, org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.jLabel24.text")); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(jLabel23, org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.jLabel23.text")); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(jLabel25, org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.jLabel25.text")); // NOI18N

        forBody.setColumns(20);
        forBody.setRows(5);
        forBody.setText(org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.forBody.text")); // NOI18N
        jScrollPane5.setViewportView(forBody);

        org.openide.awt.Mnemonics.setLocalizedText(addForButton, org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.addForButton.text")); // NOI18N
        addForButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                addForButtonActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout forPaneLayout = new javax.swing.GroupLayout(forPane);
        forPane.setLayout(forPaneLayout);
        forPaneLayout.setHorizontalGroup(
            forPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(forPaneLayout.createSequentialGroup()
                .addGap(26, 26, 26)
                .addGroup(forPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel25, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel21))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(forPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(forPaneLayout.createSequentialGroup()
                        .addComponent(forType, javax.swing.GroupLayout.PREFERRED_SIZE, 77, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(forName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(forOp, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(forValue, javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel22)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(forName2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(forOp2, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(forConValue, javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel24, javax.swing.GroupLayout.PREFERRED_SIZE, 13, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(forName3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(forOp3, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(forPaneLayout.createSequentialGroup()
                        .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 614, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(addForButton)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel23)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        forPaneLayout.setVerticalGroup(
            forPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(forPaneLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(forPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel21)
                    .addComponent(forType, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(forName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(forOp, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(forValue, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel22)
                    .addComponent(forName2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(forOp2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(forConValue, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(forName3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(forOp3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel24)
                    .addComponent(jLabel23))
                .addGroup(forPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, forPaneLayout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jLabel25)
                        .addGap(62, 62, 62))
                    .addGroup(forPaneLayout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(forPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(addForButton)
                            .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(0, 53, Short.MAX_VALUE))))
        );

        loopTabPane.addTab(org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.forPane.TabConstraints.tabTitle"), forPane); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(addForEach, org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.addForEach.text")); // NOI18N
        addForEach.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                addForEachActionPerformed(evt);
            }
        });

        jLabel35.setIcon(new javax.swing.ImageIcon(getClass().getResource("/edu/mass/qcc/qcccodewizard/Question.png"))); // NOI18N
        org.openide.awt.Mnemonics.setLocalizedText(jLabel35, org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.jLabel35.text")); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(jLabel28, org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.jLabel28.text")); // NOI18N

        forEachType.setEditable(true);
        forEachType.setModel(new VariableTypeComboBoxModel());
        forEachType.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                forEachTypeActionPerformed(evt);
            }
        });

        forEachName.setEditable(true);
        forEachName.setModel(new VariableNameComboModel());

        org.openide.awt.Mnemonics.setLocalizedText(jLabel36, org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.jLabel36.text")); // NOI18N

        forEachArrayName.setEditable(true);
        forEachArrayName.setModel(new VariableNameComboModel());

        org.openide.awt.Mnemonics.setLocalizedText(jLabel37, org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.jLabel37.text")); // NOI18N

        forEachBody.setColumns(20);
        forEachBody.setRows(5);
        forEachBody.setText(org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.forEachBody.text")); // NOI18N
        jScrollPane7.setViewportView(forEachBody);

        org.openide.awt.Mnemonics.setLocalizedText(jLabel38, org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.jLabel38.text")); // NOI18N

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel28)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(forEachType, javax.swing.GroupLayout.PREFERRED_SIZE, 77, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(forEachName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel36)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(forEachArrayName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jLabel37)
                        .addGap(293, 293, 293)
                        .addComponent(jLabel35))
                    .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(jLabel38, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGroup(jPanel2Layout.createSequentialGroup()
                            .addComponent(jScrollPane7, javax.swing.GroupLayout.PREFERRED_SIZE, 614, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(addForEach))))
                .addGap(0, 186, Short.MAX_VALUE))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel28)
                            .addComponent(forEachType, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(forEachName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel36)
                            .addComponent(forEachArrayName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel37)))
                    .addComponent(jLabel35))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jScrollPane7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(addForEach))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel38)
                .addContainerGap(33, Short.MAX_VALUE))
        );

        loopTabPane.addTab(org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.jPanel2.TabConstraints.tabTitle"), jPanel2); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(jLabel10, org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.jLabel10.text")); // NOI18N

        ifVarName.setEditable(true);
        ifVarName.setModel(new VariableNameComboModel());

        ifVarOp.setModel(new OperatorListModel());

        ifVarValue.setEditable(true);
        ifVarValue.setModel(new VariableNameComboModel());

        org.openide.awt.Mnemonics.setLocalizedText(jLabel11, org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.jLabel11.text")); // NOI18N

        ifBody.setColumns(20);
        ifBody.setRows(5);
        ifBody.setText(org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.ifBody.text")); // NOI18N
        jScrollPane1.setViewportView(ifBody);

        org.openide.awt.Mnemonics.setLocalizedText(jLabel12, org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.jLabel12.text")); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(addIfStat, org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.addIfStat.text")); // NOI18N
        addIfStat.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                addIfStatActionPerformed(evt);
            }
        });

        jLabel27.setIcon(new javax.swing.ImageIcon(getClass().getResource("/edu/mass/qcc/qcccodewizard/Question.png"))); // NOI18N
        org.openide.awt.Mnemonics.setLocalizedText(jLabel27, org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.jLabel27.text")); // NOI18N

        javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
        jPanel8.setLayout(jPanel8Layout);
        jPanel8Layout.setHorizontalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel10)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel8Layout.createSequentialGroup()
                        .addComponent(ifVarName, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(ifVarOp, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(ifVarValue, javax.swing.GroupLayout.PREFERRED_SIZE, 125, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel11)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jLabel27))
                    .addGroup(jPanel8Layout.createSequentialGroup()
                        .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel12)
                            .addGroup(jPanel8Layout.createSequentialGroup()
                                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 676, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(addIfStat)))
                        .addGap(0, 129, Short.MAX_VALUE))))
        );
        jPanel8Layout.setVerticalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel10)
                        .addComponent(ifVarName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(ifVarOp, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(ifVarValue, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel11))
                    .addComponent(jLabel27))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(addIfStat))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel12)
                .addGap(0, 32, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab(org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.jPanel8.TabConstraints.tabTitle"), jPanel8); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(jLabel16, org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.jLabel16.text")); // NOI18N

        elseIfName.setEditable(true);
        elseIfName.setModel(new VariableNameComboModel());

        elseIfOp.setModel(new OperatorListModel());

        elseIfValue.setEditable(true);
        elseIfValue.setModel(new VariableNameComboModel());

        org.openide.awt.Mnemonics.setLocalizedText(jLabel17, org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.jLabel17.text")); // NOI18N

        elseIfBody.setColumns(20);
        elseIfBody.setRows(5);
        elseIfBody.setText(org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.elseIfBody.text")); // NOI18N
        jScrollPane3.setViewportView(elseIfBody);

        org.openide.awt.Mnemonics.setLocalizedText(jLabel18, org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.jLabel18.text")); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(addElseIfButton, org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.addElseIfButton.text")); // NOI18N
        addElseIfButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                addElseIfButtonActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(jPanel9);
        jPanel9.setLayout(jPanel9Layout);
        jPanel9Layout.setHorizontalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel9Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel16)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel9Layout.createSequentialGroup()
                        .addComponent(elseIfName, javax.swing.GroupLayout.PREFERRED_SIZE, 112, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(elseIfOp, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(elseIfValue, javax.swing.GroupLayout.PREFERRED_SIZE, 126, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel17))
                    .addComponent(jLabel18, javax.swing.GroupLayout.PREFERRED_SIZE, 15, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 782, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(addElseIfButton))
        );
        jPanel9Layout.setVerticalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel9Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel16)
                    .addComponent(elseIfName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(elseIfOp, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(elseIfValue, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel17))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 77, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel18)
                    .addComponent(addElseIfButton))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab(org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.jPanel9.TabConstraints.tabTitle"), jPanel9); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(addElseButton, org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.addElseButton.text")); // NOI18N
        addElseButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                addElseButtonActionPerformed(evt);
            }
        });

        org.openide.awt.Mnemonics.setLocalizedText(jLabel29, org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.jLabel29.text")); // NOI18N

        elseBody.setColumns(20);
        elseBody.setRows(5);
        elseBody.setText(org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.elseBody.text")); // NOI18N
        jScrollPane6.setViewportView(elseBody);

        org.openide.awt.Mnemonics.setLocalizedText(jLabel30, org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.jLabel30.text")); // NOI18N

        javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
        jPanel7.setLayout(jPanel7Layout);
        jPanel7Layout.setHorizontalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel29)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addComponent(jScrollPane6, javax.swing.GroupLayout.PREFERRED_SIZE, 632, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(addElseButton)
                        .addContainerGap(157, Short.MAX_VALUE))
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addComponent(jLabel30, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(0, 0, Short.MAX_VALUE))))
        );
        jPanel7Layout.setVerticalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel7Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addComponent(jLabel29)
                        .addGap(0, 0, Short.MAX_VALUE))
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jScrollPane6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(addElseButton))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel30)
                        .addContainerGap(27, Short.MAX_VALUE))))
        );

        jTabbedPane1.addTab(org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.jPanel7.TabConstraints.tabTitle"), jPanel7); // NOI18N

        javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
        jPanel6.setLayout(jPanel6Layout);
        jPanel6Layout.setHorizontalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jTabbedPane1)
        );
        jPanel6Layout.setVerticalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 182, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 9, Short.MAX_VALUE))
        );

        loopTabPane.addTab(org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.jPanel6.TabConstraints.tabTitle"), jPanel6); // NOI18N

        jTabbedPane2.addTab(org.openide.util.NbBundle.getMessage(MainCodePopup.class, "MainCodePopup.loopTabPane.TabConstraints.tabTitle"), loopTabPane); // NOI18N

        javax.swing.GroupLayout decPaneLayout = new javax.swing.GroupLayout(decPane);
        decPane.setLayout(decPaneLayout);
        decPaneLayout.setHorizontalGroup(
            decPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jTabbedPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 908, Short.MAX_VALUE)
        );
        decPaneLayout.setVerticalGroup(
            decPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(decPaneLayout.createSequentialGroup()
                .addComponent(jTabbedPane2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 433, Short.MAX_VALUE))
        );

        jScrollPane9.setViewportView(decPane);

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addComponent(jScrollPane9)
                .addGap(0, 0, 0))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addComponent(jScrollPane9, javax.swing.GroupLayout.DEFAULT_SIZE, 272, Short.MAX_VALUE)
                .addGap(0, 0, 0))
        );

        jPanel1.setBounds(0, 0, 0, 0);
        jLayeredPane1.add(jPanel1, javax.swing.JLayeredPane.DEFAULT_LAYER);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jLayeredPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 926, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jLayeredPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 277, Short.MAX_VALUE)
        );
    }// </editor-fold>//GEN-END:initComponents

    private void addElseButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addElseButtonActionPerformed
        // Adds an Else code block
        // Get the currently open java source

        try {
            JTextComponent jtc = EditorRegistry.lastFocusedComponent();

            CodeDrop codedrop = new CodeDrop();

            String varBody = elseBody.getText();
            String code = "else {\n" + "\t\t" + varBody + "\n}\n";

            System.out.println("Inserting Code");
            try {
                CodeDrop.insert(code, jtc);
            } catch (BadLocationException ex) {
                Exceptions.printStackTrace(ex);
            }
        } catch (java.lang.Throwable t) {

            JOptionPane.showMessageDialog(this,
                    "Please fill in the body and click the Add button.");

        }
    }//GEN-LAST:event_addElseButtonActionPerformed

    private void addElseIfButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addElseIfButtonActionPerformed
        // Adds an Else If into the document
        // Get the currently open java source

        try {
            JTextComponent jtc = EditorRegistry.lastFocusedComponent();
            CodeDrop codedrop = new CodeDrop();
            //get the name for the condition variable, get the operator, and variable or value

            String varName = elseIfName.getSelectedItem().toString();
            String varOperator = elseIfOp.getSelectedItem().toString();
            String varValue = elseIfValue.getSelectedItem().toString();
            String varBody = elseIfBody.getText();

            edu.mass.qcc.qcccodewizard.CheckVariableName cvn = new edu.mass.qcc.qcccodewizard.CheckVariableName();
            if (cvn.isGood(varName)) {
                //If name is valid, add it to the editor.
                System.out.println("Valid Variable Name");
                String code = "else if(" + varName + " " + varOperator + " " + varValue + ") { \n" + "\t\t" + varBody + "\n} \n";
                try {
                    //Insert into document
                    System.out.println("Inserting Code");
                    CodeDrop.insert(code, jtc);
                } catch (BadLocationException ex) {
                    Exceptions.printStackTrace(ex);
                }
            } else {

                JOptionPane.showMessageDialog(this, "Invalid Variable Name. Try Again.");
                System.out.println("Variable name not valid!");
            }
        } catch (java.lang.Throwable t) {

            JOptionPane.showMessageDialog(this,
                    "All fields must be filled out correctly.");

        }
    }//GEN-LAST:event_addElseIfButtonActionPerformed

    private void addIfStatActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addIfStatActionPerformed
        // This code adds a basic If Statement to the document
        // Get the currently open java source

        try {
            JTextComponent jtc = EditorRegistry.lastFocusedComponent();
            CodeDrop codedrop = new CodeDrop();
            //get the name for the condition variable, get the operator, and variable or value

            String varName = ifVarName.getSelectedItem().toString();
            String varOperator = ifVarOp.getSelectedItem().toString();
            String varValue = ifVarValue.getSelectedItem().toString();
            String varBody = ifBody.getText();

            CheckVariableName cvn = new CheckVariableName();
            if (cvn.isGood(varName)) {
                //If name is valid, add it to the editor.
                System.out.println("Valid Variable Name");
                String code = "if (" + varName + " " + varOperator + " " + varValue + ") { \n" + "\t\t" + varBody + "\n} \n";
                try {
                    //Insert into document
                    System.out.println("Inserting Code");
                    CodeDrop.insert(code, jtc);
                } catch (BadLocationException ex) {
                    Exceptions.printStackTrace(ex);
                }
            } else {

                JOptionPane.showMessageDialog(this, "Invalid Variable Name. Try Again.");
                System.out.println("Variable name not valid!");
            }
        } catch (java.lang.Throwable t) {

            JOptionPane.showMessageDialog(this,
                    "All fields must be filled out correctly.");

        }
    }//GEN-LAST:event_addIfStatActionPerformed

    private void forEachTypeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_forEachTypeActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_forEachTypeActionPerformed

    private void addForEachActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addForEachActionPerformed
        // Adds a foreach to the document.
        try {
            JTextComponent jtc = EditorRegistry.lastFocusedComponent();
            CodeDrop codedrop = new CodeDrop();
            //get the name for the condition variable, get the operator, and variable or value

            String varName;
            String varValue;
            String varBody;
            String varType;

            if (forEachName.getSelectedItem().toString() != null) {
                varName = forEachName.getSelectedItem().toString();

            } else {
                varName = "";
            }
            if ((forEachType.getSelectedIndex() != -1)) {
                varType = forEachType.getSelectedItem().toString();
            } else {
                varType = "";
            }
            if (forEachArrayName.getSelectedItem() != null) {
                varValue = forEachArrayName.getSelectedItem().toString();
            } else {
                varValue = "";
            }
            varBody = forEachBody.getText();
            CheckVariableName cvn = new CheckVariableName();
            if (cvn.isGood(varName)) {
                //If name is valid, add it to the editor.
                System.out.println("Valid Variable Name Found");
                String code = "for (" + varType + " " + varName + " : " + varValue + ") \n" + "{\n\t\t" + varBody + "\n}";
                try {
                    //Insert into document
                    System.out.println("Inserting Code");
                    CodeDrop.insert(code, jtc);
                } catch (BadLocationException ex) {
                    Exceptions.printStackTrace(ex);
                }
            } else {

                JOptionPane.showMessageDialog(this, "Invalid Variable Name. Try Again.");
                System.out.println("Variable name not valid!");
            }

        } catch (java.lang.Throwable t) {

            JOptionPane.showMessageDialog(this, "All Fields must be filled out.");

        }
    }//GEN-LAST:event_addForEachActionPerformed

    private void addForButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addForButtonActionPerformed
        // Adds a For loop to the document.
        // Get the currently open java source

        try {
            JTextComponent jtc = EditorRegistry.lastFocusedComponent();
            CodeDrop codedrop = new CodeDrop();
            //get the name for the condition variable, get the operator, and variable or value

            String varType = "";
            if (!(forType.getSelectedIndex() == -1)) {
                varType = forType.getSelectedItem().toString();
            }
            if (!"Fix in Future".equals(varType)) {
                varType = varType.toLowerCase();
            }

            String varName = forName.getSelectedItem().toString();
            String varOperator = forOp.getSelectedItem().toString();
            String varValue = forValue.getSelectedItem().toString();
            String varName2 = forName2.getSelectedItem().toString();
            String varOperator2 = forOp2.getSelectedItem().toString();
            String varName3 = forName3.getSelectedItem().toString();
            String varOperator3 = forOp3.getSelectedItem().toString();
            String varValue2 = forConValue.getSelectedItem().toString();

            String varBody = forBody.getText();

            CheckVariableName cvn = new CheckVariableName();
            if (cvn.isGood(varName)) {
                //If name is valid, add it to the editor.
                System.out.println("Valid Variable Name");
                String code = "for (" + varType + " " + varName + " " + varOperator + " " + varValue + "; " + varName + " " + varOperator2 + " " + varValue2 + "; " + varName + " " + varOperator3 + ") { \n" + "\t\t" + varBody + "\n} \n";
                try {
                    //Insert into document
                    System.out.println("Inserting Code");
                    CodeDrop.insert(code, jtc);
                } catch (BadLocationException ex) {
                    Exceptions.printStackTrace(ex);
                }
            } else {

                JOptionPane.showMessageDialog(this, "Invalid Variable Name. Try Again.");
                System.out.println("Variable name not valid!");
            }
        } catch (java.lang.Throwable t) {

            JOptionPane.showMessageDialog(this,
                    "All Fields must be filled in correctly.");

        }
    }//GEN-LAST:event_addForButtonActionPerformed

    private void forTypeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_forTypeActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_forTypeActionPerformed

    private void addDoWhileActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addDoWhileActionPerformed
        // Adds a Do While loop into the current document.
        // Get the currently open java source

        try {
            JTextComponent jtc = EditorRegistry.lastFocusedComponent();
            CodeDrop codedrop = new CodeDrop();
            //get the name for the condition variable, get the operator, and variable or value

            String varName = doWhileName.getSelectedItem().toString();
            String varOperator = doWhileOp.getSelectedItem().toString();
            String varValue = doWhileValue.getSelectedItem().toString();
            String varBody = doBody.getText();

            CheckVariableName cvn = new CheckVariableName();
            if (cvn.isGood(varName)) {
                //If name is valid, add it to the editor.
                System.out.println("Valid Variable Name");
                String code = "do {\n\t\t" + varBody + "\n} while(" + varName + " " + varOperator + " " + varValue + "); \n";
                try {
                    //Insert into document
                    System.out.println("Inserting Code");
                    CodeDrop.insert(code, jtc);
                } catch (BadLocationException ex) {
                    Exceptions.printStackTrace(ex);
                }
            } else {

                JOptionPane.showMessageDialog(this, "Invalid Variable Name. Try Again.");
                System.out.println("Variable name not valid!");
            }
        } catch (java.lang.Throwable t) {

            JOptionPane.showMessageDialog(this,
                    "All fields must be filled in correctly.");

        }
    }//GEN-LAST:event_addDoWhileActionPerformed

    private void addWhileButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addWhileButtonActionPerformed
        // Adds a while loop to the document
        // Get the currently open java source
        try {
            JTextComponent jtc = EditorRegistry.lastFocusedComponent();
            CodeDrop codedrop = new CodeDrop();
            //get the name for the condition variable, get the operator, and variable or value

            String varName;
            String varValue;
            String varBody;
            String varOperator;

            if (whileName.getSelectedItem().toString() != null) {
                varName = whileName.getSelectedItem().toString();

            } else {
                varName = "";
            }
            if ((whileOp.getSelectedIndex() != -1)) {
                varOperator = whileOp.getSelectedItem().toString();
            } else {
                varOperator = "";
            }
            if (whileValue.getSelectedItem() != null) {
                varValue = whileValue.getSelectedItem().toString();
            } else {
                varValue = "";
            }
            varBody = whileBody.getText();
            CheckVariableName cvn = new CheckVariableName();
            if (cvn.isGood(varName)) {
                //If name is valid, add it to the editor.
                System.out.println("Valid Variable Name Found");
                String code = "while(" + varName + " " + varOperator + " " + varValue + ") \n" + "{\n\t\t" + varBody + "\n}";
                try {
                    //Insert into document
                    System.out.println("Inserting Code");
                    CodeDrop.insert(code, jtc);
                } catch (BadLocationException ex) {
                    Exceptions.printStackTrace(ex);
                }
            } else {

                JOptionPane.showMessageDialog(this, "Invalid Variable Name. Try Again.");
                System.out.println("Variable name not valid!");
            }

        } catch (java.lang.Throwable t) {

            JOptionPane.showMessageDialog(this, "All Fields must be filled out.");

        }
    }//GEN-LAST:event_addWhileButtonActionPerformed

    private void addStrButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addStrButtonActionPerformed
        //This adds a new string or string array into the current document

        //Get the currently open java source
        try {
            java.io.File currentFile = FileUtil.toFile(NbEditorUtilities.getFileObject(EditorRegistry.lastFocusedComponent().getDocument()));
            System.out.println(currentFile.getName());//sending the code to the cursor
            Document doc = EditorRegistry.lastFocusedComponent().getDocument();
            JTextComponent jtc = EditorRegistry.lastFocusedComponent();
            CodeDrop codedrop = new CodeDrop();
            if (strCb.isSelected()) {
                //get the name for the variable and value

                String varName = strName.getText();
                String varOperator = "=";
                String varValue = strValue.getText();
                CheckVariableName cvn = new CheckVariableName();
                if (cvn.isGood(varName)) {
                    //If name is valid, add it to the editor.
                    System.out.println("Valid Variable Name");
                    //Add the code to the document
                    String code = "String " + varName + " " + varOperator + " \"" + varValue + "\";";
                    try {
                        //Insert into document
                        System.out.println("Inserting Code");
                        CodeDrop.insert(code, jtc);
                    } catch (BadLocationException ex) {
                        Exceptions.printStackTrace(ex);
                    }
                } else {

                    JOptionPane.showMessageDialog(this, "Invalid Variable Name. Try Again.");
                    System.out.println("Variable name not valid!");
                }

            }
            if (strArrCb.isSelected()) {
                //get the name for the Array and array values.

                String varName = strArrName.getText();
                String varOperator = "=";
                String varValue = strArrValue.getText();
                CheckVariableName cvn = new CheckVariableName();
                if (cvn.isGood(varName)) {
                    //If name is valid, add it to the editor.
                    System.out.println("Valid Variable Name");
                    //Build the values for the array.
                    String myValueArray[] = varValue.split(" ");
                    String newValueStr = "";
                    for (String values : myValueArray) {
                        newValueStr += "\"" + values + "\",";
                    }
                    //Add the code to the document
                    String code = "String " + varName + "[] " + varOperator + " {" + newValueStr + "};";
                    try {
                        //Insert into document
                        System.out.println("Inserting Code");
                        CodeDrop.insert(code, jtc);
                    } catch (BadLocationException ex) {
                        Exceptions.printStackTrace(ex);
                    }
                } else {

                    JOptionPane.showMessageDialog(this, "Invalid Variable Name. Try Again.");
                    System.out.println("Variable name not valid!");
                }

            }
        } catch (java.lang.Throwable t) {

            JOptionPane.showMessageDialog(this,
                    "All Fields must be filled out correctly.");

        }
    }//GEN-LAST:event_addStrButtonActionPerformed

    private void addVarDecButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addVarDecButtonActionPerformed
        //This adds a new declaration, condition of statement into the current document

        //Get the currently open java source
        try {
            JTextComponent jtc = EditorRegistry.lastFocusedComponent();
            CodeDrop codedrop = new CodeDrop();
            //Find which check box is marked
            //Do this is decCb is checked
            if (decCb.isSelected()) {
                //get the name for the variable, get the operator, and variable or value
                String varType = vCb2.getSelectedItem().toString();
                String varName = vCb3.getSelectedItem().toString();
                if (!"Fix in Future".equals(varType)) {
                    varType = varType.toLowerCase();
                }

                CheckVariableName cvn = new CheckVariableName();
                if (cvn.isGood(varName)) {
                    //If name is valid, add it to the editor.
                    System.out.println("Valid Variable Name");
                } else {

                    JOptionPane.showMessageDialog(this, "Invalid Variable Name. Try Again.");
                    System.out.println("Variable name not valid!");
                }
                String varOperator = vCb4.getSelectedItem().toString();
                String varValue = vCb5.getSelectedItem().toString();

                String varOperator2 = "";
                String varValue2 = "";
                if (vCb6.getSelectedIndex() != 0 && vCb8.getSelectedIndex() != -1) {
                    varOperator2 = vCb6.getSelectedItem().toString();
                    varValue2 = vCb8.getSelectedItem().toString();

                }
                //Add the code to the document
                String code = varType + " " + varName + " " + varOperator + " " + varValue + " " + varOperator2 + " " + varValue2 + ";";
                try {
                    //Insert into document
                    System.out.println("Inserting Code");
                    CodeDrop.insert(code, jtc);
                } catch (BadLocationException ex) {
                    Exceptions.printStackTrace(ex);
                }

            }
            if (stCb.isSelected()) {
                //get the name for the variable, get the operator, and variable or value

                String varName = vCb9.getSelectedItem().toString();
                CheckVariableName cvn = new CheckVariableName();
                if (cvn.isGood(varName)) {
                    //If name is valid, add it to the editor.
                    System.out.println("Valid Variable Name");
                } else {

                    JOptionPane.showMessageDialog(this, "Invalid Variable Name. Try Again.");
                    System.out.println("Variable name not valid!");
                }
                String varOperator = "=";
                String varValue = vCb10.getSelectedItem().toString();

                //Add the code to the document
                String code = varName + " " + varOperator + " " + varValue + ";";
                try {
                    //Insert into document
                    System.out.println("Inserting Code");
                    CodeDrop.insert(code, jtc);
                } catch (BadLocationException ex) {
                    Exceptions.printStackTrace(ex);
                }

            }
            if (conCb.isSelected()) {
                //get the name for the variable, get the operator, and variable or value

                String varName = vCb11.getSelectedItem().toString();
                String varOperator = vCb12.getSelectedItem().toString();
                String varValue = vCb13.getSelectedItem().toString();
                CheckVariableName cvn = new CheckVariableName();
                if (cvn.isGood(varName)) {
                    //If name is valid, add it to the editor.
                    System.out.println("Valid Variable Name");
                } else {

                    JOptionPane.showMessageDialog(this, "Invalid Variable Name. Try Again.");
                    System.out.println("Variable name not valid!");
                }

                //Add the code to the document
                String code = varName + " " + varOperator + " " + varValue + ";";
                try {
                    //Insert into document
                    System.out.println("Inserting Code");
                    CodeDrop.insert(code, jtc);
                } catch (BadLocationException ex) {
                    Exceptions.printStackTrace(ex);
                }

            }
        } catch (java.lang.Throwable t) {

            JOptionPane.showMessageDialog(this,
                    "All fields must be filled out correctly.");

        }
    }//GEN-LAST:event_addVarDecButtonActionPerformed

    private void vCb10ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_vCb10ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_vCb10ActionPerformed

    private void vCb2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_vCb2ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_vCb2ActionPerformed

    private void addVariableButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addVariableButtonActionPerformed

        //This adds a new variable into the current document

        //Get the currently open java source
        try {
            JTextComponent jtc = EditorRegistry.lastFocusedComponent();
            CodeDrop codedrop = new CodeDrop();
            //Find the type of variable
            GroupButtonUtils gbu = new GroupButtonUtils();
            String varType = "";
            if (gbu.getSelectedButtonText(buttonGroupVariable) != null) {
                varType = gbu.getSelectedButtonText(buttonGroupVariable);

                if (!"Fix in Future".equals(varType)) {
                    varType = varType.toLowerCase();
                }
                System.out.println(varType);
                //Get the name for the variable
                String varName = varNameCombo1.getSelectedItem().toString();
                System.out.println(varName);

                //Make sure its a valid variable name...
                CheckVariableName cvn = new CheckVariableName();
                if (cvn.isGood(varName)) {
                    //If name is valid, add it to the editor.
                    System.out.println("Valid Name");

                    //Construct the output string
                    String code = varType + " " + varName + ";";
                    try {
                        //Insert into document
                        System.out.println("Inserting Code");
                        CodeDrop.insert(code, jtc);
                    } catch (BadLocationException ex) {
                        Exceptions.printStackTrace(ex);
                    }

                } else {

                    JOptionPane.showMessageDialog(this, "Invalid Variable Name. Try Again.");
                    System.out.println("Variable name not valid!");
                }

            }
        } catch (java.lang.Throwable t) {

            JOptionPane.showMessageDialog(this, "All Fields must be filled out.");

        }
        //Call combobox models visit method to update with the new variable.

    }//GEN-LAST:event_addVariableButtonActionPerformed
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton addDoWhile;
    private javax.swing.JButton addElseButton;
    private javax.swing.JButton addElseIfButton;
    private javax.swing.JButton addForButton;
    private javax.swing.JButton addForEach;
    private javax.swing.JButton addIfStat;
    private javax.swing.JButton addStrButton;
    private javax.swing.JButton addVarDecButton;
    private javax.swing.JButton addVariableButton;
    private javax.swing.JButton addWhileButton;
    private javax.swing.ButtonGroup buttonGroupVariable;
    private javax.swing.JCheckBox conCb;
    private javax.swing.JCheckBox decCb;
    private javax.swing.JPanel decPane;
    private javax.swing.JTextArea doBody;
    private javax.swing.JPanel doPane;
    private javax.swing.JComboBox doWhileName;
    private javax.swing.JComboBox doWhileOp;
    private javax.swing.JComboBox doWhileValue;
    private javax.swing.JTextArea elseBody;
    private javax.swing.JTextArea elseIfBody;
    private javax.swing.JComboBox elseIfName;
    private javax.swing.JComboBox elseIfOp;
    private javax.swing.JComboBox elseIfValue;
    private javax.swing.JPanel expPane;
    private javax.swing.JTextArea forBody;
    private javax.swing.JComboBox forConValue;
    private javax.swing.JComboBox forEachArrayName;
    private javax.swing.JTextArea forEachBody;
    private javax.swing.JComboBox forEachName;
    private javax.swing.JComboBox forEachType;
    private javax.swing.JComboBox forName;
    private javax.swing.JComboBox forName2;
    private javax.swing.JComboBox forName3;
    private javax.swing.JComboBox forOp;
    private javax.swing.JComboBox forOp2;
    private javax.swing.JComboBox forOp3;
    private javax.swing.JPanel forPane;
    private javax.swing.JComboBox forType;
    private javax.swing.JComboBox forValue;
    private javax.swing.JTextArea ifBody;
    private javax.swing.JPanel ifPane;
    private javax.swing.JComboBox ifVarName;
    private javax.swing.JComboBox ifVarOp;
    private javax.swing.JComboBox ifVarValue;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel24;
    private javax.swing.JLabel jLabel25;
    private javax.swing.JLabel jLabel26;
    private javax.swing.JLabel jLabel27;
    private javax.swing.JLabel jLabel28;
    private javax.swing.JLabel jLabel29;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel30;
    private javax.swing.JLabel jLabel31;
    private javax.swing.JLabel jLabel32;
    private javax.swing.JLabel jLabel33;
    private javax.swing.JLabel jLabel34;
    private javax.swing.JLabel jLabel35;
    private javax.swing.JLabel jLabel36;
    private javax.swing.JLabel jLabel37;
    private javax.swing.JLabel jLabel38;
    private javax.swing.JLabel jLabel39;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel40;
    private javax.swing.JLabel jLabel41;
    private javax.swing.JLabel jLabel42;
    private javax.swing.JLabel jLabel43;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JLayeredPane jLayeredPane1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JPanel jPanel7;
    private javax.swing.JPanel jPanel8;
    private javax.swing.JPanel jPanel9;
    private javax.swing.JRadioButton jRadioButton1;
    private javax.swing.JRadioButton jRadioButton2;
    private javax.swing.JRadioButton jRadioButton3;
    private javax.swing.JRadioButton jRadioButton4;
    private javax.swing.JRadioButton jRadioButton5;
    private javax.swing.JRadioButton jRadioButton6;
    private javax.swing.JRadioButton jRadioButton7;
    private javax.swing.JRadioButton jRadioButton8;
    private javax.swing.JRadioButton jRadioButton9;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JScrollPane jScrollPane5;
    private javax.swing.JScrollPane jScrollPane6;
    private javax.swing.JScrollPane jScrollPane7;
    private javax.swing.JScrollPane jScrollPane9;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JTabbedPane jTabbedPane2;
    private javax.swing.JTabbedPane loopTabPane;
    private javax.swing.JCheckBox stCb;
    private javax.swing.JCheckBox strArrCb;
    private javax.swing.JTextField strArrName;
    private javax.swing.JTextField strArrValue;
    private javax.swing.JCheckBox strCb;
    private javax.swing.JTextField strName;
    private javax.swing.JPanel strPane;
    private javax.swing.JTextField strValue;
    private javax.swing.JComboBox vCb10;
    private javax.swing.JComboBox vCb11;
    private javax.swing.JComboBox vCb12;
    private javax.swing.JComboBox vCb13;
    private javax.swing.JComboBox vCb2;
    private javax.swing.JComboBox vCb3;
    private javax.swing.JComboBox vCb4;
    private javax.swing.JComboBox vCb5;
    private javax.swing.JComboBox vCb6;
    private javax.swing.JComboBox vCb8;
    private javax.swing.JComboBox vCb9;
    private javax.swing.JComboBox varNameCombo1;
    private javax.swing.JPanel varPane;
    private javax.swing.JTextArea whileBody;
    private javax.swing.JComboBox whileName;
    private javax.swing.JComboBox whileOp;
    private javax.swing.JComboBox whileValue;
    // End of variables declaration//GEN-END:variables

    void writeProperties(java.util.Properties p) {
        // better to version settings since initial version as advocated at
        // http://wiki.apidesign.org/wiki/PropertyFiles
        p.setProperty("version", "1.0");
        // TODO store your settings
    }

    void readProperties(java.util.Properties p) {
        String version = p.getProperty("version");
        // TODO read your settings according to their version
    }
}
